import React, {Component} from 'react';
import { Globalstyle } from './style';
import Header from './common/header';
import './App.css'
import store from "./store";
// 第三方: 根元素
import { Provider } from 'react-redux';
// 路由懒加载
import { BrowserRouter, Route } from "react-router-dom";
import Home from "./pages/home";
import Detail from "./pages/detail";

class App extends Component {
    constructor(props) {
        super(props);
        this.state = {}
    }
    render() {
        return (
            <div style={{height: '100%'}}>
                {/* 全局使用store*/}
                <Provider store={ store }>
                    <Header/>
                    <BrowserRouter>
                        <Route path='/' exact component={Home}></Route>
                        <Route path='/detail' component={Detail}></Route>
                    </BrowserRouter>
                    <Globalstyle/>
                </Provider>
            </div>
        )
    }

}

export default App;
